﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace sync
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo repoDir;
            FileInfo repoFileInfo;
            XmlSyncDataProvider dataProvider;
            PeerConnectionProvider connectionProvider;
            Repository repo;
            repoDir = new DirectoryInfo(@"C:\TestRepo\");
            repoFileInfo = new FileInfo(@"C:\TestRepo\sync.config");

            dataProvider = new XmlSyncDataProvider(new XmlSyncDataProviderInfo());
            connectionProvider = new PeerConnectionProvider(new PeerConnectionProviderInfo() { MeshPassword = "NAMEING" });

            if (repoFileInfo.Exists)
            {
                repo = new Repository(repoFileInfo);
            }
            else
            {

                repo = Repository.Create(repoDir, repoFileInfo, dataProvider, connectionProvider);

            }

            repo.BringOnline();
            Console.ReadLine();
        }
    }
}
